package com.qf.flowerlanguage.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.flowerlanguage.entity.Classes;
import com.qf.flowerlanguage.entity.Home;
import com.qf.flowerlanguage.entity.Product;
import com.qf.flowerlanguage.entity.User;
import com.qf.flowerlanguage.service.HomeService;
import com.qf.flowerlanguage.service.ProductService;
import com.qf.flowerlanguage.vo.HomeVo;
import com.qf.flowerlanguage.vo.ProductVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Objects;

@Controller
@RequestMapping("/home")
public class HomeController {
    @Autowired
    private HomeService homeService;
    @Autowired
    private ProductService productService;


    public HomeController(ProductService productService){
        this.productService=productService;
    }
    @RequestMapping("/homePage")
    @ResponseBody
    public HomeVo homePage(){
        List<Home> list = homeService.list();
        List<Product> list1=productService.list();
        HomeVo homeVo = new HomeVo();
        homeVo.setMessage("传入成功");
        homeVo.setHomes(list);
        homeVo.setProducts(list1);
        return homeVo;
    }



    }
